﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.5
// Code is generated on: Thursday, October 16, 2008 1:31:24 PM
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Collections;
using System.Collections.Generic;
using NL.ADA.ConfigService.DAL;
using NL.ADA.ConfigService.DAL.FactoryClasses;
using NL.ADA.ConfigService.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace NL.ADA.ConfigService.DAL.RelationClasses
{
	/// <summary>Implements the static Relations variant for the entity: Config. </summary>
	public partial class ConfigRelations
	{
		/// <summary>CTor</summary>
		public ConfigRelations()
		{
		}

		/// <summary>Gets all relations of the ConfigEntity as a list of IEntityRelation objects.</summary>
		/// <returns>a list of IEntityRelation objects</returns>
		public virtual List<IEntityRelation> GetAllRelations()
		{
			List<IEntityRelation> toReturn = new List<IEntityRelation>();


			toReturn.Add(this.ApplicationEntityUsingApplicationId);
			toReturn.Add(this.ConfigTypeEntityUsingConfigType);
			toReturn.Add(this.ModeEntityUsingModeId);
			return toReturn;
		}

		#region Class Property Declarations



		/// <summary>Returns a new IEntityRelation object, between ConfigEntity and ApplicationEntity over the m:1 relation they have, using the relation between the fields:
		/// Config.ApplicationId - Application.Id
		/// </summary>
		public virtual IEntityRelation ApplicationEntityUsingApplicationId
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne, "Application", false);
				relation.AddEntityFieldPair(ApplicationFields.Id, ConfigFields.ApplicationId);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ApplicationEntity", false);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ConfigEntity", true);
				return relation;
			}
		}
		/// <summary>Returns a new IEntityRelation object, between ConfigEntity and ConfigTypeEntity over the m:1 relation they have, using the relation between the fields:
		/// Config.ConfigType - ConfigType.Id
		/// </summary>
		public virtual IEntityRelation ConfigTypeEntityUsingConfigType
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne, "ConfigType_", false);
				relation.AddEntityFieldPair(ConfigTypeFields.Id, ConfigFields.ConfigType);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ConfigTypeEntity", false);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ConfigEntity", true);
				return relation;
			}
		}
		/// <summary>Returns a new IEntityRelation object, between ConfigEntity and ModeEntity over the m:1 relation they have, using the relation between the fields:
		/// Config.ModeId - Mode.Id
		/// </summary>
		public virtual IEntityRelation ModeEntityUsingModeId
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne, "Mode", false);
				relation.AddEntityFieldPair(ModeFields.Id, ConfigFields.ModeId);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ModeEntity", false);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ConfigEntity", true);
				return relation;
			}
		}

		/// <summary>stub, not used in this entity, only for TargetPerEntity entities.</summary>
		public virtual IEntityRelation GetSubTypeRelation(string subTypeEntityName) { return null; }
		/// <summary>stub, not used in this entity, only for TargetPerEntity entities.</summary>
		public virtual IEntityRelation GetSuperTypeRelation() { return null;}

		#endregion

		#region Included Code

		#endregion
	}
}
